<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://www.springframework.org/tags/form"  prefix="sf"%>
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>机票信息</title>
    <style type="text/css">
    	.label{
    		display: inline-block;
    		width: 100px;
    		text-align: right;
    	}
    
    </style>
  </head>
  
  <body>
  	<h1>新增机票</h1>
  	<!-- 使用Spring表单，必须将对应的对象ft绑定进作用域 -->
    <sf:form method="post" commandName="ft">
    	<sf:label cssClass="label" path="flightId">航班：</sf:label>
    	<sf:select path="flightId">
    		<sf:options  items="${flights}" itemLabel="flightCode" itemValue="id"/>
    	</sf:select><br>
    	<sf:label cssClass="label" path="flightDate">日期：</sf:label>
    	<sf:input path="flightDate"/><br>
    	<sf:label cssClass="label" path="ticketPrice">票价：</sf:label>
    	<sf:input path="ticketPrice"/><br>
    	<sf:label cssClass="label" path="sellCompany">航空公司：</sf:label>
    	<sf:input path="sellCompany"/><sf:errors path="sellCompany"></sf:errors><br>
    	<input type="submit" value="提交">
    </sf:form>
  </body>
</html>
